﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ATest.Bll;

namespace ATest.Tests.MockObjects
{
    public class MockQuestion : Moq.Mock<Question>
    {
        public MockQuestion(int id)
        {
            Setup(x => x.Id).Returns(id);
        }

        public static List<MockQuestion> CreateList(int count)
        {
            List<MockQuestion> tmp = new List<MockQuestion>();
            while (tmp.Count < count)
            {
                tmp.Add(
                    new MockQuestion(
                        tmp.Count + 1
                    ));
            }
            return tmp.ToList();
        }

        public void SetTest(Test test)
        {
            Setup(x => x.TestId).Returns(test.Id);
            Setup(x => x.Test).Returns(test);
        }
    }
}
